home *** CD-ROM | disk | FTP | other *** search
/ What CD? 12 / What PC June 1997.iso / multi / cyber / cyber95 / _setup.1 / HORN1.POP < prev    next >
Encoding:
Text File  |  1996-09-01  |  2.1 KB  |  82 lines

  1. // file : horn1.pop
  2. // this file describes a simple horn-form which uses egg-scaling to (hopefully),
  3. // allow for a variety of more elegant, (ie. "spindly"), forms than usual.
  4. // the forms produced by this script are all fairly 'straight' looking, and
  5. // the segments do not change size along the spine.
  6.  
  7.  
  8. /////////////////////////////////
  9. // population display settings //
  10. /////////////////////////////////
  11.  
  12. population 0
  13. dimensions = 1
  14. colour_model RGB
  15. render_quality flat
  16.  
  17.  
  18. ////////////
  19. // genome //
  20. ////////////
  21.  
  22. genome 0 {
  23.  
  24.     ////////////////
  25.     // initialise //
  26.     ////////////////
  27.  
  28.     // initialise scaling
  29.     eggScale( 1 : 0.5 : 1 ),   // allow smaller primitives than standard
  30.  
  31.     // initialise material properties
  32.     setColour( hsv<.5,.5,.75> : hsv<0,.2,.5> : hsv<.99999,.99999,.99999> ),
  33.     setTexture( norder false:toggle ),
  34.     setBitmap( norder 0 : 0 : 20 ),
  35.     *setWrap( norder 0 : 0 : 2 ),
  36.  
  37.     ///////////////
  38.     // horn loop //
  39.     ///////////////
  40.  
  41.     repeat( 1 : 1 : 60,   // #horn-segments
  42.         
  43.         // horn-segment code is made up of 2 distinct code blocks; the first block is executed
  44.         // within a new scope, called the "segment rib"; the second block is executed within
  45.         // the current scope and is called the "segment spine"
  46.         join(
  47.  
  48.             /////////
  49.             // rib //
  50.             /////////
  51.  
  52.             // in this horn the rib visually consists of a single primtive
  53.             *scope(
  54.                 // rotate so that rib does not point in same direction as the spine
  55.                 rotate( <0,0,0> : <-2,-2,-2> : <2,2,2> ),
  56.                 // move away from spine slightly
  57.                 forward( 0 : -2 : 2 ),
  58.                 // re-shape primitive
  59.                 eggVectorScale( <1,1,1> : <.75,.75,.75> : <1.25,1.25,1.25> ),
  60.                 // determine primitive type and lay an egg
  61.                 egg( 0 : 0 : 10 ),
  62.                 lay
  63.             ),
  64.  
  65.             ///////////
  66.             // spine //
  67.             ///////////
  68.  
  69.             // in this horn the spine has no visual form, but simply updates the turtle
  70.             // state ready for the next segment
  71.             forward( 0.3 : -1 : 1 ),
  72.             scale( 1.05 : 1.01 : 1.1 ),
  73.             bankLeft( dtor(10 : -25 : 25) ),
  74.             moveHue( 0.01 : 0.005 : 0.05 )
  75.         )
  76.     )
  77. }
  78.  
  79.  
  80. // eof : horn1.pop
  81.  
  82.